package com.lxw.controller;

import com.lxw.properties.DataSourceProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableConfigurationProperties(DataSourceProperties.class)
public class DataController {

    @Autowired
    private DataSourceProperties dataSourceProperties;

    @ResponseBody
    @RequestMapping("/data")
    public String outData(){
        System.out.println(dataSourceProperties);
        return "you can check DataSourceProperties~";
    }
}
